//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_pmselchanged.sqf"
#include "x_setup.sqf"

#include "x_uiinc.sqf"

private ["_selection", "_control", "_selectedIndex"];
disableSerialization;
PARAMS_1(_selection);

_control = _selection select 0;
_selectedIndex = _selection select 1;

if (_selectedIndex == -1) exitWith {};

if (GVAR(show_player_marker) != _selectedIndex) then {
	GVAR(show_player_marker) = _selectedIndex;
	0 spawn FUNC(deleteplayermarker);
};